
//
//  PlanModelFrame.m
//  test
//
//  Created by 朱圳 on 2018/2/2.
//  Copyright © 2018年 朱圳. All rights reserved.
//

#import "PlanModelFrame.h"
#import "NSString+Mobile.h"

@implementation PlanModelFrame

- (void)setModel:(PlanModel *)model{
    _model = model;
    
    double maxWidth = ScreenWidth - 10*2- 1*3 - 40;
    double cellHeight = 0;
    
    for (ContentModel * contentModel in model.list) {
        
        cellHeight += [contentModel.content getLabelHeighWithMaxWidth:maxWidth font:19];
        NSLog(@"cellHeight======%lf",cellHeight);
    }
    self.cellHeight = cellHeight+1;
    self.topLineRect = CGRectMake(30, self.cellHeight-1, ScreenWidth-20-40, 1);
    self.hLineOneRect = CGRectMake(30, 0, 1, cellHeight);
    self.classNamLabelRect = CGRectMake(CGRectGetMaxX(self.hLineOneRect)+7, 0, 40, cellHeight);
    self.hLineTwoRect = CGRectMake(CGRectGetMaxX(self.classNamLabelRect)+10, 0, 1, cellHeight);
    self.tableVRect = CGRectMake(CGRectGetMaxX(self.hLineTwoRect), 0, maxWidth-17-40, cellHeight);
    
    self.hLineThreeRect = CGRectMake(CGRectGetMaxX(self.tableVRect), 0, 1, cellHeight);
    
    NSLog(@"self.cellHeight====%lf",self.cellHeight);
    
}

@end
